package pl.krzosekm.vehicleregister.gui;
import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JLabel;

import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JTabbedPane;
import org.jdesktop.application.Action;
import org.jdesktop.application.Application;
import org.jdesktop.application.ApplicationActionMap;

import org.jdesktop.application.SingleFrameApplication;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
/**
 * 
 */
public class VehicleRegister extends SingleFrameApplication {
	private JTabbedPane mainPanel;
	private RepairPanel repairPanel;
	private JProgressBar progressBar;
	private JLabel infoLabel;
	private JButton jButton1;
	private RepairListPanel repairListPanel;
	private CustomerPanel customerPanel;
	private VehiclePanel vehiclePanel;
	private JPanel infoPanel;

    @Override
    protected void startup() {
    	{
			jButton1 = new JButton();
			jButton1.setName("jButton1");
			jButton1.setAction(getAppActionMap().get("repairRegisterAction"));
		}
    	BorderLayout mainFrameLayout = new BorderLayout();
    	getMainFrame().getContentPane().setLayout(mainFrameLayout);
//    	getMainFrame().setSize(564, 265);
    	{
    		mainPanel = new JTabbedPane();
    		getMainFrame().getContentPane().add(getMainPanel(), BorderLayout.CENTER);
    		{
    			vehiclePanel = new VehiclePanel(jButton1);
    			mainPanel.addTab("Pojazd", null, vehiclePanel, null);
    		}
    		{
    			customerPanel = new CustomerPanel(jButton1);
    			mainPanel.addTab("Klient", null, customerPanel, null);
    		}
    		{
    			repairPanel = new RepairPanel();
    			mainPanel.addTab("Zgłoszenie", null, repairPanel, null);
    			repairPanel.setName("repairPanel");
    			
    		}
    		{
    			repairListPanel = new RepairListPanel();
    			mainPanel.addTab("Lista napraw", null, repairListPanel, null);
    		}
    	}
    	{
    		infoPanel = new JPanel();
    		BorderLayout infoPanelLayout = new BorderLayout();
    		infoPanel.setLayout(infoPanelLayout);
    		getMainFrame().getContentPane().add(infoPanel, BorderLayout.SOUTH);
    		{
    			progressBar = new JProgressBar();
    			infoPanel.add(progressBar, BorderLayout.EAST);
    		}
    		{
    			infoLabel = new JLabel();
    			infoPanel.add(infoLabel, BorderLayout.WEST);
    			infoLabel.setName("infoLabel");
    		}
    	}
        show(mainPanel);
    }

    public static void main(String[] args) {
        launch(VehicleRegister.class, args);
    }
    
    public JTabbedPane getMainPanel() {
    	return mainPanel;
    }
    
    @Action
    public void repairRegisterAction()
    {
    	System.out.println("test");
    }
    
    /**
    * Returns the action map used by this application.
     * Actions defined using the Action annotation
     * are returned by this method
     */
	private ApplicationActionMap getAppActionMap() {
		return Application.getInstance().getContext().getActionMap(this);
	}

}
